package com.danieldura.highrise.data
{
	public class Address implements HighriseData
	{
		public static const WORK:String = "Work";
		public static const HOME:String = "Home";
		public static const OTHER:String = "Other";
		
		public var id:int;
		public var city:String;
		public var country:String;
		public var state:String;
		public var street:String;
		public var zip:String;
		public var location:String;
		
		public function parse( data:XML ):void
		{
			id = data.id;
			city = data.city;
			country = data.country;
			state = data.state;
			street = data.street;
			zip = data.zip;
			location = data.location;
		}
		
		public function toXML():XML
		{
			var data:XML = new XML( <address></address> );
			data.id = id;
			data.city = city;
			data.country = country;
			data.state = state;
			data.street = street;
			data.zip = zip;
			data.location = location;
			return data;
		}
		
		public function toXMLString():String
		{
			return toXML().toXMLString();
		}
				
	}
}

/*
    <address>
      <id type="integer">1</id>
      <city>Sampleville</city>
      <country>United States</country>
      <state>IL</state>
      <street>123 Example Ave</street>
      <zip>55555</zip>
      <location>#{ Work || Home || Other }</location>
    </address>
*/